//
//  BKLXYMarkerView.swift
//  BKL_HealthProject
//
//  Created by yjmac on 2018/8/2.
//  Copyright © 2018年 yunjing. All rights reserved.
//


import Foundation
import Charts

public class BKLXYMarkerView: BalloonMarker {
    public var xAxisValueFormatter: IAxisValueFormatter
    public var yAxisValueFormatter: IAxisValueFormatter

    public init(color: UIColor, font: UIFont, textColor: UIColor, insets: UIEdgeInsets,
                xAxisValueFormatter: IAxisValueFormatter, yAxisValueFormatter: IAxisValueFormatter) {
        self.xAxisValueFormatter = xAxisValueFormatter
        self.yAxisValueFormatter = yAxisValueFormatter

        super.init(color: color, font: font, textColor: textColor, insets: insets)
    }
    
    public override func refreshContent(entry: ChartDataEntry, highlight: Highlight) {
        let string =  xAxisValueFormatter.stringForValue(entry.x, axis: XAxis())
            + " | "
            + yAxisValueFormatter.stringForValue(entry.x, axis: XAxis())
        setLabel(string)
    }
}
